<!Doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>新书上架...</title>
    <link rel="stylesheet" type="text/css" href="../css/common.css"/>
    <link rel="stylesheet" type="text/css" href="../css/main.css"/>
    <script type="text/javascript" src="../js/modernizr.min.js"></script>
    <script type="text/javascript" src="../js/jquery-1.11.0.min.js"></script>
    <script>
        $(function () {
            $("#header").load("../static/header.html");
            $("#left").load("../static/left.html");
            $.get("../user/getLoginInfo.do", {}, function (data) {
                if (data == null) {
                    alert("请先登录。。");
                    location.href = "../user/login.do";
                }
            });
            //注册 添加
            $("#myform_regist").submit(function () {
                $.post("../user/doAddUser.do",$(this).serialize(),function (data) {
                        if(data != null){
                            alert(data.errorInfo);
                            if(data.errorType != 0){
                                location.href="Login.html";
                            }
                        }
                });
                //不提交表单
                return false;
            });
        });
    </script>
</head>
<body>

<div class="container clearfix">
    <div id="header"></div>
    <div id="left"></div>
    <!--/sidebar-->
    <div class="main-wrap">
        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="index.html">书籍管理</a><span
                    class="crumb-step">&gt;</span><span class="crumb-name">新用户注册</span></div>
        </div>
        <div class="result-wrap">
            <form action="../user/doAddUser.do" method="post" id="myform_regist" enctype="multipart/form-data">
                <div class="config-items">
                    <div class="config-title">
                        <h1><i class="icon-font">&#xe00a;</i>新用户注册</h1>
                    </div>
                    <div class="result-content">
                        <table width="100%" class="insert-tab">
                            <tbody>
                            <tr>
                                <th width="15%"><i class="require-red">*</i>姓名：</th>
                                <td><input type="text" placeholder="请输入姓名.." name="name" id="name"
                                           class="common-text"></td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>用户名：</th>
                                <td><input type="text" name="username" id="username" class="common-text"></td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>密码：</th>
                                <td><input type="password" name="password" id="password" class="common-text"></td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>确认密码：</th>
                                <td><input type="password" name="password1" id="password1" class="common-text"></td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>生日：</th>
                                <td><input type="date" name="birthday" id="birthday" class="common-text"></td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>性别：</th>
                                <td>
                                    <select name="sex">
                                        <option value="0">男</option>
                                        <option value="1">女</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>电话号码：</th>
                                <td><input type="number" name="phone" id="phone" class="common-text"></td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>邮箱：</th>
                                <td><input type="email" name="email" id="email" class="common-text"></td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>注册身份：</th>
                                <td>
                                    <select name="uType" id="uType">
                                        <option value="0">会员</option>
                                        <option value="1">商家</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <th></th>
                                <td>
                                    <!--<input type="submit" value="提交" class="btn btn-primary btn6 mr10">-->
                                    <input type="submit" value="注册" class="btn btn-primary btn6 mr10" id="submit">
                                    <input type="button" value="返回" onclick="history.go(-1)" class="btn btn6">
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>